<%
Dim conn
Dim rs
Dim sqlcount
Dim getcount
F_ID = Request.Form.Item("F_ID")
F_CODE = Request.Form.Item("F_CODE")
F_NAME = Request.Form.Item("F_NAME")
F_ADDRESS = Request.Form.Item("F_ADDRESS")
F_TEL_NUMBER = Request.Form.Item("F_TEL_NUMBER")
F_OSTAN = Request.Form.Item("F_OSTAN")
F_SHAHRESTAN = Request.Form.Item("F_SHAHRESTAN")

F_ID = Replace(F_ID,"'","")
F_CODE = Replace(F_CODE,"'","")
F_NAME = Replace(F_NAME,"'","")
F_ADDRESS = Replace(F_ADDRESS,"'","")
F_TEL_NUMBER = Replace(F_TEL_NUMBER,"'","")
F_OSTAN = Replace(F_OSTAN,"'","")
F_SHAHRESTAN = Replace(F_SHAHRESTAN,"'","")
set conn = Server.Createobject("ADODB.Connection")
set  rs = Server.Createobject("ADODB.Recordset")
ConnStr = "DSN=dbpr_sql;UID=sa;PWD=hhhhhhhh;"
conn.Mode = 3
conn.Open (ConnStr)
sqlcount = "SELECT MAX() as numlines FROM WAREHOUSE"
set rs = conn.execute(sqlcount)
getcount = rs.fields("numlines")
Session("tablecount") = getcount
Session("Tablename") = Session("Tablename") 
Session("fieldname") = Session("fieldname")
SQL="INSERT INTO WAREHOUSE(ID,CODE,NAME,ADDRESS,TEL_NUMBER,OSTAN,SHAHRESTAN) VALUES(" & F_ID & "," & "'" & F_CODE & "'" & "," & "'" & F_NAME & "'" & "," & "'" & F_ADDRESS & "'" & "," & "'" & F_TEL_NUMBER & "'" & "," & "'" & F_OSTAN & "'" & "," & "'" & F_SHAHRESTAN & "'"  & ")"
set rs = conn.execute(SQL)
conn.close
set rs = Nothing
set conn = Nothing
Response.redirect("INS_WAREHOUSE1.asp")
%>
